package neuronvisualizer;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;

import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JFrame;

public class Simulator implements ActionListener{
	private JFrame Options;
	private JButton tDivisors;
	private JCheckBox[] showTypes = {new JCheckBox("RS",true),new JCheckBox("LTS",true),new JCheckBox("FS",true),new JCheckBox("IB",true)};
	private Visual showModel;
	
	public static void main(String[] args)throws IOException{
		new Simulator();
	}
	
	public Simulator(){
		Options = new JFrame("Options");
		Options.setLayout(null);
		Options.setSize(200,300);
		Options.setVisible(true);
		
		for(int i=0;i<showTypes.length;i++){
			showTypes[i].addActionListener(this);
			showTypes[i].setBounds(10,10+(i*25),150,20);
			Options.add(showTypes[i]);
		}
		
		tDivisors = new JButton("Toggle Dividers");
		tDivisors.addActionListener(this);
		tDivisors.setBounds(10,200,150,20);
		Options.add(tDivisors);
		
		try{showModel=new Visual();}catch(Exception e){}
	}

	public void actionPerformed(ActionEvent arg0) {
		if(arg0.getSource() == tDivisors){
			showModel.toggleSections();
		}
		
		for(int i=0;i<showTypes.length;i++){
			if(arg0.getSource()==showTypes[i]){
				showModel.toggleType(showTypes[i].getText());
			}
		}
	}
}
